The present invention relates to software or computer programs, and more specifically, to methods, systems and computer program products that embed collected profiling test case information into a binary file of a computer program and subsequently recompile the program.
Profile driven feedback (PDF) is a software compiler feedback optimization technique that allows users of compiler type software programs to provide the compiler optimizer with sample program execution context information that oftentimes improves optimization quality (i.e., program runtime performance). Profiling typically refers to collecting information about the operational behavior of a compiler type of computer program (e.g., C++, Fortran) during a profiling or data gathering stage while the program is being run. The collected information typically comprises data which best represents common usage scenarios of the program (e.g., areas of the program that are executed more often than other areas of the program). The collected information is then used to improve the optimization of the program for future executions of the program during normal runtime execution (e.g., by a customer). In the profiling stage, program performance is measured while running one or more benchmarks that are representative of the way the program will be used in actual practice (e.g., by a customer).
Typically, a test case representing an expected execution context is used to drive the program, and profile information is collected and then fed back into the compiler optimizer. The compiler then recompiles the program taking into consideration (and taking advantage of) the profile information previously collected. This information typically includes histograms for basic blocks executed and branches taken by the program. Execution hot spots can be easily inferred using the histograms, which might guide several compiler optimization decisions at the recompilation phase.
However, profile driven feedback typically involves user intervention. For example, the user has to specify which tests are to run to generate the profile information. The user also has to run those tests, and then point the compiler to the generated profile information for the optimization stage to start. Also, the tests might be modified either intentionally or accidentally, resulting in different profiles and eventually different PDF-optimized binary files (“binaries”). This lack of determinism might cause several debugging and maintenance issues throughout the lifetime of a project.